package com.mangguo.tingjian.account.rest;

import com.mangguo.tingjian.common.Result;
import com.mangguo.tingjian.account.dto.RoleDto;
import com.mangguo.tingjian.account.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/role")
@Slf4j
public class RoleController {

    @Resource
    private RoleService roleService;

    @GetMapping("/all")
    public Result<List<RoleDto>> allRole(){
        return Result.success(roleService.findAllRole());
    }


}
